Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dev Container #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bethmaloney
Copy link
Contributor

@bethmaloney bethmaloney commented Apr 14, 2024

Add Dev Container support to simplify initial setup.

I'm using Ruby 3.2 as 3.3 is throwing an error undefined method []' for nil (NoMethodError) when I try to run bundle exec jekyll serve. I also had to add webrick to GemFile to prevent an error when using Ruby 3.x. The Ruby LSP is also throwing an error but I don't think there's actually much ruby in this project so I might look at what's causing that error later (unless someone else can sort it out).

I'm far from a ruby expert so let me know if any of the versions, etc are wrong and I'll fix them. I have to admit this took longer then I expected to get running.

Also add webrick to GemFile to prevent error when using Ruby 3.x
@fredericDelaporte
Copy link
Member

I do not know if any NHibernate contributor is much knowledgeable about Ruby. I just know it was not running for me under Windows. Instead, I test it with a Linux VM (Debian running with VirtualBox), and have no issue with it.

Since this project is only meant for running as a GitHub page, doing some Microsoft related changes in it does not look sound to me.

@bethmaloney
Copy link
Contributor Author

Hi @fredericDelaporte,

Sorry that's my fault for not explaining the rationale for adding Dev Containers to this project. Dev Containers are a way of using containers to setup a development environment for you. They're usable in both windows (WSL2) and Linux and while primarily supported by VS Code and GitHub other editors such as IntelliJ are adding support.

When I first tried to get the project running locally I wasn't sure what OS or Ruby versions were supported or honestly even how to install (I'm not a Ruby dev). And to be honest I didn't really want to install Ruby for just this project. By using Dev Containers the Ruby version and OS are fixed and the Bundler version is automatically updated to the correct version. This makes it easier for new contributors as they only need to launch the dev container and all of the dependencies are taken care of.

If you'd like to test this without installing WSL2/Docker Desktop you can run it straight from your browser using GitHub. Navigate to the branch on my repo and select code -> Create Codespace. GitHub provides all users with a few hundred minutes of Code Space for free so you should be fine to test it out. You'll note that you can restore the Gems and launch the documentation server from the editor in your browser. The experience locally is very similiar.

image

The configuration will use the docker image at https://hub.docker.com/_/microsoft-devcontainers-ruby. Specifically Debian Bookworm with Ruby 3.2.

I'll note that many popular projects use Dev Containers to improve the on-boarding experience including:

My aim with this PR is to make it as simple as possible to run the doc server locally and contribute to this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants